<template>
  <div class="todo-container">
    <div class="todo-wrap">
      <HeaderComponent></HeaderComponent>
      <MainComponent></MainComponent>
      <FooterComponent></FooterComponent>
    </div>
  </div>
</template>

<script>

import HeaderComponent from "@/components/Header";
import MainComponent from "@/components/Main";
import FooterComponent from "@/components/Footer";
import {mapState} from 'vuex'

export default {
  name: "App",
  components: {
    HeaderComponent,
    MainComponent,
    FooterComponent,
  },
  computed:{
    ...mapState(['todos']),
  },
  watch:{
    todos:{
     handler(newTodos){
        localStorage.setItem('todos',JSON.stringify(newTodos))
     },
     deep:true
    }
  }
};
</script>

<style scoped>
.todo-container {
  width: 600px;
  margin: 0 auto;
}
.todo-container .todo-wrap {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
}
</style>
